function foo(...args) {
//    console.log(arguments);  //类数组
   let res = 0
   for (let i = 0; i < args.length;i++) {
      res += args[i]
   }
   return res

}  
foo(1,2,3,4)


function foo1([x,y])  {
    
}

foo1([1, 2])